#ifndef __ULTILS_H__
#define __ULTILS_H__

#include "sys/time.h"
#include "time.h"
#include "stdio.h"
#include "stdlib.h"
#include "linux/input.h"

#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <termios.h>
#include <sys/select.h>
#include <sys/types.h>
#include <poll.h>
#include "arpa/inet.h"
#include "string.h"

void simu_key(unsigned char kb_id, unsigned short ch);

void getFormatTimeNow(char *pTimenow);
void getTimeNow(unsigned int* year,unsigned char* mon,unsigned char* day,
                unsigned char* hour,unsigned char* min,unsigned char* sec);
unsigned long long GetTickCount();

void enable_dev(const char* strDev);

void BytesToHexStr(unsigned char *bBuffer,int bLen,char *strBuf);
bool HexStrToBytes(const char *strBuf,unsigned char *byBuf,int &byLen);

void Numeric2Bytes(const unsigned long &num,unsigned char *bytes,int byts_Len,bool small_head=false);
bool Bytes2Numeric(const unsigned char *bytes,int blen,unsigned long &num,bool small_head=false);

void Numeric2HexStr(const unsigned long &num,char *strBuf,int byts_Len,bool small_head=false);
bool HexStr2Numeric(const char *strBuf,bool small_head,unsigned long &num);

bool isIP4AddrString(const char *strBuf,int len);

#endif // __ULTILS_H__
